package com.bto.solar.work.controller;

import com.bto.solar.work.common.R;
import com.bto.solar.work.dao.IDeviceOptionService;
import com.bto.solar.work.entity.DeviceOption;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 设备信息--厂家编号（1）、名称（2）供应商等 前端控制器
 * </p>
 *
 * @author adrian
 * @since 2023-08-09
 */
@RestController
@RequestMapping("/device-option")
public class DeviceOptionController {
    @Autowired
    private IDeviceOptionService deviceOptionService;
    @ApiModelProperty("设备预选项")
    @GetMapping()
    public R downloadExcelOrderInfo(@RequestParam String deviceType , @RequestParam Integer infoType)  {
        List<DeviceOption> deviceOptions = deviceOptionService.lambdaQuery()
                .eq(DeviceOption::getDeviceType, deviceType)
                .eq(DeviceOption::getInfoType, infoType).list();
        return R.ok(deviceOptions);
    }
}
